package BehavioralPattern.ChainOfReponsibility;

public class Client {
    public static void main(String[] args) {
        Approver a,b,c,d;
        a = new Director("A");
        b = new VicePresident("B");
        c = new President("C");
        d = new Congress("D");

        // 创建职责链
        a.setSuccessor(b);
        b.setSuccessor(c);
        c.setSuccessor(d);

        // 创建采购单
        PurchaseRequest purchaseRequest1 = new PurchaseRequest(45000,10001,"A书");

        PurchaseRequest purchaseRequest2 = new PurchaseRequest(60000,10002,"B书");

        PurchaseRequest purchaseRequest3 = new PurchaseRequest(160000,10003,"C书");

        PurchaseRequest purchaseRequest4 = new PurchaseRequest(800000,10004,"D书");

        a.processRequest(purchaseRequest1);
        a.processRequest(purchaseRequest2);
        a.processRequest(purchaseRequest3);
        a.processRequest(purchaseRequest4);
    }
}
